The following is based on Korean Patent Application No. 99-50596 filed Nov. 15, 1999, herein incorporated by reference.
1. Field of the Invention
The present invention relates to a method and apparatus for estimating illuminant chromaticity and a method and apparatus for converting the estimated illuminant chromaticity into desired illuminant chromaticity using software.
2. Description of the Related Art
There are two kinds of methods in estimating illuminant chromaticity in a scene: one using hardware and the other using software. In methods using hardware, illuminant chromaticity is estimated based on direct measurement of a scene with a sensor which can estimate illuminant information. In methods using software, the illuminant chromaticity of the scene is estimated from an acquired image input. The former is simply implemented, but it is difficult to improve the accuracy. The later is more advantageous in improving the accuracy than the former, but its implementation is complex. Recently, however, as microprocessors are developed, the implementation of the latter method using software becomes simpler.
According to a conventional technique, an illuminant component is detected using hardware attached to a camera to perform white balance or color correction. A detector or the like for detecting light directly emitted from a light source is mounted within a camera. Alternatively, a control button corresponding to a particular illuminant is fixed on a camera, and the illuminant chromaticity is determined based on the input by a user using the control button.
However, the method using a detector has a problem of an increase in cost due to additional hardware. Moreover, this method is difficult to be adapted to an image obtained by remote shooting in which the direct detection of an illuminant by hardware is impossible. In the method using a control button operated by a user, many control buttons are needed to appropriately correspond to various illuminant components.
To solve these problems, a method of detecting illuminant chromaticity from the image itself is disclosed in U.S. Pat. No. 4,685,071, issued to Hsien-Che Lee on Aug. 4, 1987. In this method, the color of the specularly reflected light from the scene in an image and the color of light employed to illuminate the scene is determined. According to this method, the color of specularly reflected light can be detected by detecting a plurality of sets of points having constant hue and varying saturation on a plurality of differently colored surfaces in the image. To detect color changes independent of brightness, the image is transformed to a color space having chromaticity coordinates, and color edges where the color of the image is changing most rapidly are detected. In this case, to determine whether the rapid color changes are due to a change in saturation or hue, data sets on both sides of the rapid color change edge are collected to fit straight lines. When the slopes of the straight lines fit through the data sets collected from both sides of the edge are equal, it is determined that the rapid color changes are due to changes in saturation and that the data sets are for detection of the color of the illuminant. Parameters for determining the illuminant color are obtained from the paths of intersections of the straight lines obtained from the plurality of data sets near the edges due to the changes in saturation.
A major problem of the method of Hsien-Che Lee is the amount of operating time required. In addition, the collection of data on both sides from data at each edge is not easy. Since the operation is performed in the unit of edges, the operation of collecting data from both sides, fitting straight lines, and comparing and determining the straight lines are repeatedly performed for a lot of edges.
A method disclosed in U.S. Pat. No. 5,495,428, issued to Schwartz et al. on Feb. 27 1996, has a very similar conception to that of the method of Hsien-Che Lee. The method of Schwartz et al. determines illuminant chromaticity by plotting a histogram for an entire image, obtaining straight lines which are major axes for respective clusters, and appropriately weighting each straight line. Thus, it is similar to the method of Hsien-Che Lee in conception. However, the two methods are different in operation. The method of Hsien-Che Lee is advantageous in obtaining data to be processed. However, the method has a disadvantage of requiring a large amount of computation and complexity for analysis. In the method of Schwartz et al., it is difficult to obtain data to be processed, but analysis is simply performed.
A perceived illumination estimate scheme represents the illuminant chromaticity of an image in numbers and sorts out and excludes self-luminous regions, thereby effectively and stably estimating the illuminant chromaticity. A highlight estimate scheme is based on the dichromatic reflection model by Shafer in which it is assumed that light reflected from a constantly colored surface can be represented by the synthesis of surface reflection and body reflection and that the spectral composition of the surface reflection is the same as the spectral composition of an illuminant.
The perceived illumination estimate scheme guarantees stability in determining the approximate range of solutions, but has an accuracy problem due to dependence on the content of an input image. The highlight estimate scheme is advantageous in that it does not depend on the content of an input image and provides relatively accurate solutions. However, the highlight estimate scheme is disadvantageous in that many candidates, that is, intersections in a considerable range, must be considered to determine a final solution.
To solve the above problems, it is an objective of the present invention to provide an apparatus and method for estimating and converting illuminant chromaticity at high accuracy by considering the characteristic of a highlight based on relatively stable illuminant chromaticity estimated from perceived illumination.
Accordingly, to achieve the above objective in one embodiment, there is provided an illuminant chromaticity estimating apparatus including an image input unit for receiving a color image, a highlight detector for extracting highlight regions from the color image, a highlight parameter calculator for mapping the highlight regions to chromaticity coordinates and calculating geometric presentation parameters of the shape of the distribution of chromaticity coordinates, a perceived illumination illuminant chromaticity estimator for estimating illuminant chromaticity in the color image using a perceived illumination estimate scheme, and a correct chromaticity calculator for selecting from among the geometric presentation parameters a predetermined number of geometric presentation parameters near the illuminant chromaticity estimated by the perceived illumination illuminant chromaticity estimator and calculating final illuminant chromaticity using the selected geometric presentation parameters.
The perceived illumination illuminant chromaticity estimator includes an image average calculator for calculating the average value of the color image, a self-luminous threshold setting unit for multiplying the average value of the color image by a predetermined coefficient and setting a result value as a self-luminous threshold, a self-luminous region remover for removing self-luminous regions having chromaticity coordinates exceeding the self-luminous threshold from the color image, a self-luminous threshold change determiner for outputting the color image from which the self-luminous regions have been removed instead of the color image input to the image average calculator when the difference between a current self-luminous threshold and a previous self-luminous threshold exceeds a predetermined value, and an illuminant chromaticity calculator for calculating illuminant chromaticity from the average value of the color image from which the self-luminous regions have been removed.
In another embodiment, there is provided an illuminant chromaticity converting apparatus including an illumination color temperature calculator for calculating a color temperature corresponding to the estimated illuminant chromaticity in a random color image, a tristimulus value calculator for calculating a plurality of estimation reference color values corresponding to the color temperature calculated by the illumination color temperature calculator and a plurality of target reference color values corresponding to a target color temperature, a conversion coefficient calculator for calculating conversion coefficients using the plurality of estimation reference color values and the plurality of target reference color values to produce a conversion matrix, and an illuminant chromaticity change unit for applying the conversion matrix to an input color image to change the chromaticity of an illuminant in the input color image.
The illuminant chromaticity converting apparatus also includes a brightness converter for calculating the average value of brightness of the input color image who""s illuminant chromaticity has been changed and a shift offset corresponding to a target environment, adding the calculated shift offset to the RGB elements of the input color image who""s illuminant chromaticity has been changed, and expanding the contrast of the input color image.
In yet another embodiment, there is provided an illuminant chromaticity estimating method including the steps of (a) receiving a color image; (b) extracting highlight regions from the color image; (c) mapping the highlight regions to chromaticity coordinates and calculating geometric presentation parameters of the shape of the distribution of chromaticity coordinates; (d) estimating illuminant chromaticity in the color image using a perceived illumination estimate scheme; and (e) selecting from among the geometric presentation parameters a predetermined number of geometric presentation parameters near the illuminant chromaticity estimated in the step (d) and calculating final illuminant chromaticity using the selected geometric presentation parameters.
The step (d) includes the sub steps of (d1) calculating the average value of the color image; (d2) multiplying the average value of the color image by a predetermined coefficient and setting a result value as a self-luminous threshold; (d3) removing self-luminous regions having chromaticity coordinates exceeding the self-luminous threshold from the color image; (d4) repeating the steps (d1) through (d3) until the difference between a current self-luminous threshold and a previous self-luminous threshold is smaller than a predetermined value; and (d5) calculating illuminant chromaticity from the average value of the color image who""s self-luminous regions have been removed.
In still yet another embodiment, there is provided an illuminant chromaticity converting method includes the steps of (a) calculating a color temperature corresponding to the estimated illuminant chromaticity in a random color image; (b) calculating a plurality of estimation reference color values corresponding to the calculated color temperature; (c) calculating a plurality of target reference color values corresponding to a target color temperature; (d) calculating conversion coefficients using the plurality of estimation reference color values and the plurality of target reference color values to produce a conversion matrix; and (e) applying the conversion matrix to an input color image to change the chromaticity of an illuminant in the input color image.
The illuminant chromaticity converting method also includes the step of calculating the average value of brightness of the input color image who""s illuminant chromaticity has been changed and a shift offset corresponding to a target environment, adding the calculated shift offset to the RGB elements of the input color image who""s illuminant chromaticity has been changed, and expanding the contrast of the input color image.